#ifndef DOUBLY_LINKED_LIST
#define DOUBLY_LINKED_LIST

template <class T>
class DLLNode{
    public:
        DLLNode(){
            next = prev = nullptr;
        }
        DLLNode(const T& el, DLLNode *n = nullptr, DLLNode *p = nullptr){
            info = el;
            next = n;
            prev = p;
        }
        T info;
        DLLNode *next, *prev;
};

template <class T>
class DLList{
    public:
        DLList(){
            head = tail = nullptr;
        }
        ~DLList();
        bool isEmpty(){
            return head == nullptr;
        }

        void addToHead(const T&);
        void addToTail(const T&);

        T* delFromHead();
        T* delFromTail();

        void delNode(const T&);
        bool isInList(const T&) const;

    protected:
        DLLNode<T> *head, *tail;
};


#endif